home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18160 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.7 KB

  1. Path: newsserver.trl.OZ.AU!usenet
  2. From: davej@apertus.com
  3. Newsgroups: rec.games.programmer,comp.programming,comp.lang.c++,alt.msdos.programmer
  4. Subject: Re: Young programmers read me.
  5. Date: Fri, 19 Apr 96 13:17:35 EDT
  6. Organization: Telecom Research Laboratories, Melbourne, Australia.
  7. Message-ID: <4l71kv$b21@newsserver.trl.OZ.AU>
  8. References: <4l4ls7$coh@fountain.mindlink.net>
  9. NNTP-Posting-Host: 172.17.4.125
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; charset=US-ASCII
  12. X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
  13.  
  14.  
  15. In article <4l4ls7$coh@fountain.mindlink.net>, <genew@mindlink.bc.ca> writes:
  16. > davej@apertus.com wrote:
  17. > >You may "always indent your code properly" but what about when you are
  18. > >working on a large project with 6 or 20 other engineers?   Have you
  19. > >ever worked on a project where you share development code with others?
  20. > >What if the company you work for has standards that don't allow your
  21. > >method?
  22. >      Yes, I have waded through others' code.  The big problem is that
  23. > it is someone else's and not yours i.e. things are not done as you
  24. > expect.  
  25.  
  26. This is a very strong argument for coding standards.
  27.  
  28. > Extraneous brackets and such get me wondering if I might have
  29. > missed something and thus waste time.
  30. >      If the company has different standards?  Well, then I can't use
  31. > my standard there, can I?  If it's too much trouble, I'd leave.  
  32.  
  33. You'd leave your job if the company made you put braces around single
  34. statement conditionals????
  35.  
  36. > Let me reverse the question.  Suppose the company insists that you do
  37. > things my way.  What do you do?
  38.  
  39. Do things your way.   IMO, one of the top abilities in a programmer is
  40. being flexible.   If you can't read either style, quickly, you're going
  41. to miss a lot of deadlines.   This also promotes good teamwork as every
  42. piece of code you pick up will be similar in structure and flow - saves
  43. time and energy for everybody.
  44.  
  45. It still remains my opinion that the extra braces may eliminate future
  46. unforseen problems, agreed basically due to carelessness, but they do happen.
  47. If the company said "don't use 'em", I'd state my case and do what they 
  48. told me - they own the code I write, not me.
  49.  
  50. > >IMO, if you're relying on indentation to indicate program flow, you're
  51. > >just asking for trouble, and lots of it.
  52. >      Why?  Since I rarely use gotos, the indentation does a fine job
  53. > of showing the flow.  Did you mean something else?
  54.  
  55. No, just that indentation is great for readability but doesn't mean much
  56. to a compiler, at least in C.
  57.  
  58. >      I follow my standard very strictly.  It is not a complicated one
  59. > and it is usable on multiple languages.
  60. >      Anything can be screwed up.  (Fools are so ingenious.)  I refuse
  61. > to take responsibility for someone else mucking up my code later.  I
  62. > do not write obfuscated code and if the maintainer can not read clear
  63. > code, he shouldn't be modifying it.  I particularly refuse to take
  64. > responsibility for a future supporter so bad that he can't balance
  65. > braces.  That's the least of his worries in a real program.
  66.  
  67. I guess I read this as you don't like to work in teams and are very
  68. possessive about your code.
  69.  
  70. > >>      Extraneous braces cause pause.
  71. > >       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  72. > >???
  73. >      It takes time, a bit, but still time, to realize that the braces
  74. > are extraneous.  
  75.  
  76. Ahhh, I misunderstood the "cause pause".   I thought you were referring
  77. to some runtime pause, not a comprehension/readability pause.  Sorry.
  78.  
  79. > I would hate to have to maintain garbage like the above and would 
  80. > change it as soon as I could to save myself time and trouble.
  81.  
  82. I once thought that way.  It was my first job out of college 11 years
  83. ago.   I learned to adapt and become flexible, it just made my work life
  84. easier.
  85.  
  86. Cheers,
  87. Dave Johnson
  88.